package com.example.lib;

import com.sun.jdi.InterfaceType;

public abstract class Duck {

    FlyBehavior flyBehavior;
    QuarkBehavior quarkBehavior;
    public abstract void display();
    public void performanceQuark(){
        quarkBehavior.quark();
    }
    public void performanceFly(){
        flyBehavior.fly();
    }
    public void swim(){
        System.out.println("I can swim");
    }

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

    public void setQuarkBehavior(QuarkBehavior quarkBehavior) {
        this.quarkBehavior = quarkBehavior;
    }
}
